Adding some more judges, here and there.
[and.git] / lib / Mi manual de algoritmos / version_actual / src / c++ / fgetws.cpp
blobaf1ae074c08888502100271ae9ba0f4e271cd07b
1 #include <iostream>
2 #include <cassert>
3 #include <stdio.h>
4 #include <assert.h>
5 #include <wchar.h>
6 #include <wctype.h>
7 #include <locale.h>
8 using namespace std;
9 int main(){
10 assert(setlocale(LC_ALL, "en_US.UTF-8") != NULL);
11 wchar_t in_buf[512], out_buf[512];
12 swprintf(out_buf, 512,
13 L"¿Podrías escribir un número?, Por ejemplo %d. "
14 "¡Gracias, pingüino español!\n", 3);
15 fputws(out_buf, stdout);
16 fgetws(in_buf, 512, stdin);
17 int n;
18 swscanf(in_buf, L"%d", &n);
19 swprintf(out_buf, 512,
20 L"Escribiste %d, yo escribo ¿ÔÏàÚÑ~\n", n);
21 fputws(out_buf, stdout);
22 return 0;